function trim(s) {

  while (s.substring(0,1) == ' ') {

    s = s.substring(1,s.length);

  }

  while (s.substring(s.length-1,s.length) == ' ') {

    s = s.substring(0,s.length-1);

  }

  return s;

}



function del()

{

if(confirm("Are you sure you want to Delete Selected Record(s) "))

	{

		form.submit();

	}

	else

	{

	return false;

	}

}

//validate admin

function admin_form(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	



		if(trim(frm.userName.value)=='')

		 {

			 errorstr += "- Please Enter User Name.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid E-mail.\n";

		}

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate email Setting

function validateMail(frm)

{

	var email_str = document.frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if(trim(frm.subject.value) == '')

	{

	  errorstr +=  "- Please Enter Mail Subject.\n"; 

	 }

	if(trim(frm.email.value) == '')

	{

	  errorstr +=  "- Please Enter Email Address.\n"; 

	}

	else if(!(filter.test(email_str)))

		{

		errorstr +=  "- Please Enter valid E-mail.\n";

		}

	if(trim(frm.fromText.value) == '')

	{

	  errorstr +=  "- Please Enter Text for Mail.\n"; 

	}

	if(trim(frm.content.value) == '')

	{

	  errorstr +=  "- Please Enter Content for Mail.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

	

}



//validate user admincp

function validate_adminside_provider(frm)

{

		

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

		if(trim(frm.firstName.value)=='') 

		{ 

			errorstr += "- Please Enter First Name.\n";

		}

		if(trim(frm.lastName.value)=='') 

		{ 

			errorstr += "- Please Enter Last Name.\n";

		}

		if(trim(frm.jobTitle.value)=='') 

		{ 

			errorstr += "- Please Enter Job Title.\n";

		}

		if(trim(frm.organization.value)=='') 

		{ 

			errorstr += "- Please Enter Organization.\n";

		}

		if(trim(frm.country.value)=='') 

		{ 

			errorstr += "- Please Select country.\n";

		}		

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email Address.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid Email Address.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

				

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



//validate user admincp

function validate_adminside_seeker(frm)

{

		

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email Address.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid Email Address.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

		if(trim(frm.firstName.value)=='') 

		{ 

			errorstr += "- Please Enter First Name.\n";

		}

		if(trim(frm.lastName.value)=='') 

		{ 

			errorstr += "- Please Enter Last Name.\n";

		}

		if(trim(frm.city.value)=='') 

		{ 

			errorstr += "- Please Enter City.\n";

		}

		if(trim(frm.country.value)=='') 

		{ 

			errorstr += "- Please Select country.\n";

		}

		if(trim(frm.type.value)=='') 

		{ 

			errorstr += "- Please Select Type.\n";

		}

		if(trim(frm.designation.value)=='') 

		{ 

			errorstr += "- Please Enter Designation.\n";

		}

		if(trim(frm.industry.value)=='') 

		{ 

			errorstr += "- Please Select Industry.\n";

		}

		if(trim(frm.functionalArea.value)=='') 

		{ 

			errorstr += "- Please Select Functional Area.\n";

		}

		if(trim(frm.education.value)=='') 

		{ 

			errorstr += "- Please Select Educational Details.\n";

		}

		if(trim(frm.alertNotification.value)=='') 

		{ 

			errorstr += "- Please Select Alert Notification.\n";

		}

		if(trim(frm.contactWay.value)=='') 

		{ 

			errorstr += "- Please Select Way of Contact.\n";

		}

		

				

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}





//validate user admincp

function validate_adminside_events(frm)

{

		

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

		if(trim(frm.firstName.value)=='') 

		{ 

			errorstr += "- Please Enter First Name.\n";

		}

		if(trim(frm.lastName.value)=='') 

		{ 

			errorstr += "- Please Enter Last Name.\n";

		}

		if(trim(frm.jobTitle.value)=='') 

		{ 

			errorstr += "- Please Enter Job Title.\n";

		}

		if(trim(frm.organization.value)=='') 

		{ 

			errorstr += "- Please Enter Organization.\n";

		}

		if(trim(frm.country.value)=='') 

		{ 

			errorstr += "- Please Select country.\n";

		}		

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email Address.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid Email Address.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

				

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}





//validate user admincp

function validate_adminside_User(frm)

{

		

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	



		if(trim(frm.businessName.value)=='')

		 {

			 errorstr += "- Please Enter Business Title.\n";

		}

		

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email Address.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid Email Address.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

		if(trim(frm.firstName.value)=='') 

		{ 

			errorstr += "- Please Enter First Name.\n";

		}

		/*if(trim(frm.lastName.value)=='') 

		{ 

			errorstr += "- Please Enter Last Name.\n";

		}*/

		if(trim(frm.address.value)=='') 

		{ 

			errorstr += "- Please Enter Address.\n";

		}

		if(trim(frm.domainName.value)=='') 

		{ 

			errorstr += "- Please Enter Domain Name.\n";

		}

		if(trim(frm.punchLine.value)=='') 

		{ 

			errorstr += "- Please Enter Tag Line.\n";

		}

	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate user front side

function validateUser(frm)

{

		

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	



		if(trim(frm.businessName.value)=='')

		 {

			 errorstr += "- Please Enter  Title.\n";

		}

		

		if(trim(frm.email.value)=='') 

		{ 

			errorstr += "- Please Enter Email Address.\n";

		}

		else if(!(filter.test(email_str)))

		{

			errorstr +=  "- Please Enter a valid Email Address.\n";

		}

		if(trim(frm.password.value)=='') 

		{ 

			errorstr += "- Please Enter Password.\n";

		}

	 else if(frm.password.value.length<6)

		 {

			errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

		 }

		if(trim(frm.firstName.value)=='') 

		{ 

			errorstr += "- Please Enter First Name.\n";

		}

		/*if(trim(frm.lastName.value)=='') 

		{ 

			errorstr += "- Please Enter Last Name.\n";

		}*/

		if(trim(frm.address.value)=='') 

		{ 

			errorstr += "- Please Enter Address.\n";

		}

		/*if(trim(frm.city.value)=='') 

		{ 

			errorstr += "- Please Enter City.\n";

		}*/

		if(trim(frm.state.value)=='') 

		{ 

			errorstr += "- Please Select State.\n";

		}

		/*if(trim(frm.zipCode.value)=='') 

		{ 

			errorstr += "- Please Enter Zip.\n";

		}

		if(trim(frm.phone.value)=='') 

		{ 

			errorstr += "- Please Enter Phone.\n";

		}*/

		if(trim(frm.punchLine.value)=='') 

		{ 

			errorstr += "- Please Enter Tag Line.\n";

		}

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



////////////////////////////////////////////FRONT WEBSITE VALIDATION/////////////////////////////////////////////////////////////////////////////////





///validate contact user - front

function validateContactUser(frm)

{

	var email_strS =frm.senderEmail.value;

	var email_strR =frm.receiverEmail.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.senderName.value)=='') 

	{ 

		errorstr += "- Please Enter Sender Name.\n";

	}

	if(trim(frm.senderEmail.value)=='') 

	{ 

		errorstr += "- Please Enter Sender Email Address.\n";

	}

	else if(!(filter.test(email_strS)))

	{

		errorstr +=  "- Please Enter a valid Sender Email Address.\n";

	}

	

	if(trim(frm.receiverName.value)=='') 

	{ 

		errorstr += "- Please Enter Receiver Name.\n";

	}

	if(trim(frm.receiverEmail.value)=='') 

	{ 

		errorstr += "- Please Enter Receiver Email Address.\n";

	}

	else if(!(filter.test(email_strR)))

	{

		errorstr +=  "- Please Enter a valid Receiver Email Address.\n";

	}

	

	if(trim(frm.sendSubject.value)=='') 

	{ 

		errorstr += "- Please Enter Subject.\n";

	}

	if(trim(frm.message.value)=='') 

	{ 

		errorstr += "- Please Enter Message.\n";

	}

	if(trim(frm.securityCode.value)=='') 

	{ 

		errorstr += "- Please Enter Security Code.\n";

	}

	if(trim(frm.securityCode.value)!=trim(frm.sCode.value)) 

	{ 

		errorstr += "- Please Enter Same Security Code .\n";

	}	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training seeker - front

function validateSeeker(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";


	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}

	

	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	else if(frm.password.value.length<6)

	{

		errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

	}

	if(trim(frm.password.value)!=trim(frm.confirmPassword.value)) 

	{ 

		errorstr += "- Please Enter Same Password.\n";

	}		

	if(trim(frm.firstName.value)=='') 

	{ 

		errorstr += "- Please Enter First Name.\n";

	}

	if(trim(frm.lastName.value)=='') 

	{ 

		errorstr += "- Please Enter Last Name.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	if(trim(frm.type.value)=='') 

	{ 

		errorstr += "- Please Select Type.\n";

	}

	if(trim(frm.designation.value)=='') 

	{ 

		errorstr += "- Please Enter Designation.\n";

	}


	var indus =document.getElementsByName("industry[]");
	var indus_check = 0;
	for (var i = 0; i < indus.length; i++){       
		if(indus[i].checked){ 
			indus_check = 1 ;
		}
	}
	if(indus_check == 1){
	}else{ 
		if(trim(frm.industry_other_text.value)==''){
			errorstr += "- Please Select Industry.\n";
		}
	}

	var functionalA =document.getElementsByName("functionalArea[]");
	var functionalA_check = 0;
	for (var i = 0; i < functionalA.length; i++){
		if(functionalA[i].checked){
			functionalA_check = 1;
		}
	}
	
	if(functionalA_check == 1){
	}else{ 
		if(trim(frm.functional_area_other_text.value)==''){
			errorstr += "- Please Select Functional Area.\n";
		}
	}
	
	var an =document.getElementsByName("alertNotification");
	var an_check = 0;
	for (var i = 0; i < an.length; i++) 
	{
		if(an[i].checked)
		{
			an_check = 1;
		}
	}
	
	if(an_check == 1){}else 
	{ 
		errorstr += "- Please Select Preferred mode of Alerts Notification.\n";
	}


	var cw =document.getElementsByName("contactWay");
	var cw_check = 0;
	for (var i = 0; i < cw.length; i++)	{
		if(cw[i].checked){
			cw_check = 1;
		}
	}
	if(cw_check == 1){} else { 
		errorstr += "- Please Select How should training providers contact you? \n";
	}

/*
	if(trim(frm.industry.value)=='') 

	{ 

		errorstr += "- Please Enter Industry.\n";

	}


	/*


	var chosenEducation = "";

	var educationLength = frm.education.length;

	for (i = 0; i <educationLength; i++) 

	{

		if (frm.education[i].checked) 

		{

			chosenEducation = frm.education[i].value

		}

	}

	if (chosenEducation == "") 

	{ 

		errorstr += "- Please Select Educational Detail.\n";

	}
*/
	if (frm.checkbox.checked==false) { errorstr += "- Please check the check box if you agreed with our terms and condition.\n";}

	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training provider - front

function validateProvider(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

			

	if(trim(frm.firstName.value)=='') 

	{ 

		errorstr += "- Please Enter First Name.\n";

	}

	if(trim(frm.lastName.value)=='') 

	{ 

		errorstr += "- Please Enter Last Name.\n";

	}

	if(trim(frm.jobTitle.value)=='') 

	{ 

		errorstr += "- Please Enter Job Title.\n";

	}

	if(trim(frm.organization.value)=='') 

	{ 

		errorstr += "- Please Enter Organization.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}

	

	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	else if(frm.password.value.length<6)

	{

		errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

	}

	if(trim(frm.password.value)!=trim(frm.confirmPassword.value)) 

	{ 

		errorstr += "- Please Enter Same Password.\n";

	}

	var indus =document.getElementsByName("industry[]");
	var indus_check = 0;
	for (var i = 0; i < indus.length; i++){       
		if(indus[i].checked){ 
			indus_check = 1 ;
		}
	}
	
	if(indus_check == 1){
	}else{ 
		if(trim(frm.industry_other_text.value)==''){
			errorstr += "- Please Select Industry.\n";
		}
	}

	var functionalA =document.getElementsByName("functionalArea[]");
	var functionalA_check = 0;
	for (var i = 0; i < functionalA.length; i++){
		if(functionalA[i].checked){
			functionalA_check = 1;
		}
	}

	if(functionalA_check == 1){
	}else{ 
		if(trim(frm.functional_area_other_text.value)==''){
			errorstr += "- Please Select Functional Area.\n";
		}
	}
	
	
	
	if (frm.checkbox.checked==false) { errorstr += "- Please check the check box if you agreed with our terms and condition.\n";}

	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate event conductor - front

function validateEventConductor(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.firstName.value)=='') 

	{ 

		errorstr += "- Please Enter First Name.\n";

	}

	if(trim(frm.lastName.value)=='') 

	{ 

		errorstr += "- Please Enter Last Name.\n";

	}

	if(trim(frm.jobTitle.value)=='') 

	{ 

		errorstr += "- Please Enter Job Title.\n";

	}

	if(trim(frm.organization.value)=='') 

	{ 

		errorstr += "- Please Enter Organization.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}

	

	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	else if(frm.password.value.length<6)

	{

		errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

	}

	if(trim(frm.password.value)!=trim(frm.confirmPassword.value)) 

	{ 

		errorstr += "- Please Enter Same Password.\n";

	}

	if (frm.checkbox.checked==false) { errorstr += "- Please check the check box if you agreed with our terms and condition.\n";}

	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}





///validate training program - front

function validateProgram(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.title.value)=='') 

	{ 

		errorstr += "- Please Enter Title.\n";

	}

	if(trim(frm.obj1.value)=='') 

	{ 

		errorstr += "- Please Enter Objective.\n";

	}



	if(trim(frm.startDate.value)>trim(frm.endDate.value)) 

	{ 

		errorstr += "- Please Enter correct Date.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}





///validate training team - front

function validateTeam(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.name.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.position.value)=='') 

	{ 

		errorstr += "- Please Enter Position.\n";

	}

	if(trim(frm.details.value)=='') 

	{ 

		errorstr += "- Please Enter Detail.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training project - front

function validateProject(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.title.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.details.value)=='') 

	{ 

		errorstr += "- Please Enter Detail.\n";

	}

	if(trim(frm.type.value)=='') 

	{ 

		errorstr += "- Please Select Type.\n";

	}

	

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training project - front

function validateDiscussion(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.heading.value)=='') 

	{ 

		errorstr += "- Please Enter Topic.\n";

	}

	if(trim(frm.description.value)=='') 

	{ 

		errorstr += "- Please Enter Description.\n";

	}	

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate Client - front

function validateClient(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.name.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.industry.value)=='') 

	{ 

		errorstr += "- Please Select Inductry.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate Login - front

function validateLogin(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}



	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

///validate Login - front
function validateForget(frm)
{
	var email_str =frm.email.value;
	var filter=/^.+@.+\..{2,3}$/;
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	if(trim(frm.email.value)=='') 
	{ 
		errorstr += "- Please Enter Email Address.\n";
	}
	else if(!(filter.test(email_str)))
	{
		errorstr +=  "- Please Enter a valid Email Address.\n";
	}
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
		return true;
	}	
}

///validate training program - front

function validateEvent(frm)
{
	var filter=/^.+@.+\..{2,3}$/;
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	if(trim(frm.title.value)=='') 
	{ 
		errorstr += "- Please Enter Title.\n";
	}
	if(trim(frm.obj1.value)=='') 
	{ 
		errorstr += "- Please Enter Objective.\n";
	}
	
	var el =document.getElementsByName("venuType");
	var el_check = 0;
	for (var i = 0; i < el.length; i++)	{
		if(el[i].checked){
			el_check = el[i].value;
		}
	}
	
	if(el_check == '2'){
		if(trim(frm.location.value)==''){ 
			errorstr += "- Please Enter Location.\n";
		}
		if(trim(frm.city.value)==''){ 
			errorstr += "- Please Enter City.\n";
		}
		if(trim(frm.country.value)==''){ 
			errorstr += "- Please Enter Country.\n";
		}
	}





	if(trim(frm.startDate.value)>trim(frm.endDate.value)) 
	{ 
		errorstr += "- Please Enter correct Date.\n";
	}	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
		return true;
	}	
}



///validate community - front

function validateComment(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.comment.value)=='') 

	{ 

		errorstr += "- Please Enter Comment.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate payment - front

function validatePayment(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.name.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.creditCardType.value)=='') 

	{ 

		errorstr += "- Please Enter Credit Card Type.\n";

	}

	if(trim(frm.creditCardNumber.value)=='') 

	{ 

		errorstr += "- Please Enter Credit Card Number.\n";

	}

	if(trim(frm.cvv2Number.value)=='') 

	{ 

		errorstr += "- Please Enter CVC Number.\n";

	}

	if(trim(frm.address1.value)=='') 

	{ 

		errorstr += "- Please Enter address.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.state.value)=='') 

	{ 

		errorstr += "- Please Enter State.\n";

	}

	if(trim(frm.zipCode.value)=='') 

	{ 

		errorstr += "- Please Enter Zip Code.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////ADMIN WEBSITE VALIDATION/////////////////////////////////////////////////////////////////////////////////





///validate training seeker - admin

function validateSeeker_admin(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}

	

	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	else if(frm.password.value.length<6)

	{

		errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

	}

	if(trim(frm.password.value)!=trim(frm.confirmPassword.value)) 

	{ 

		errorstr += "- Please Enter Same Password.\n";

	}

	if(trim(frm.firstName.value)=='') 

	{ 

		errorstr += "- Please Enter First Name.\n";

	}

	if(trim(frm.lastName.value)=='') 

	{ 

		errorstr += "- Please Enter Last Name.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	if(trim(frm.type.value)=='') 

	{ 

		errorstr += "- Please Select Type.\n";

	}

	if(trim(frm.designation.value)=='') 

	{ 

		errorstr += "- Please Enter Designation.\n";

	}

	var chosenEducation = "";

	var educationLength = frm.education.length;

	for (i = 0; i <educationLength; i++) 

	{

		if (frm.education[i].checked) 

		{

			chosenEducation = frm.education[i].value

		}

	}

	if (chosenEducation == "") 

	{ 

		errorstr += "- Please Select Educational Detail.\n";

	}

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}







///validate training provider - admin

function validateProvider_admin(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

			

	if(trim(frm.firstName.value)=='') 

	{ 

		errorstr += "- Please Enter First Name.\n";

	}

	if(trim(frm.lastName.value)=='') 

	{ 

		errorstr += "- Please Enter Last Name.\n";

	}

	if(trim(frm.jobTitle.value)=='') 

	{ 

		errorstr += "- Please Enter Job Title.\n";

	}

	if(trim(frm.organization.value)=='') 

	{ 

		errorstr += "- Please Enter Organization.\n";

	}

	if(trim(frm.city.value)=='') 

	{ 

		errorstr += "- Please Enter City.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	if(trim(frm.email.value)=='') 

	{ 

		errorstr += "- Please Enter Email Address.\n";

	}

	else if(!(filter.test(email_str)))

	{

		errorstr +=  "- Please Enter a valid Email Address.\n";

	}

	

	if(trim(frm.password.value)=='') 

	{ 

		errorstr += "- Please Enter Password.\n";

	}

	else if(frm.password.value.length<6)

	{

		errorstr +=  "- Password Shound not be less than 6 Characters.\n"; 

	}

	if(trim(frm.password.value)!=trim(frm.confirmPassword.value)) 

	{ 

		errorstr += "- Please Enter Same Password.\n";

	}	

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}


function validateIndustry(frm)
{
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if(trim(frm.industry.value)=='') 
	{ 
		errorstr += "- Please Enter Industry Name.\n";
	}		

	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
		return true;
	}	
}


function validateFunctionalArea(frm)
{
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if(trim(frm.functionalArea.value)=='') 
	{ 
		errorstr += "- Please Enter Functional Area.\n";
	}		

	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
		return true;
	}	
}

///validate event conductor - admin

function validateAddress_admin(frm){
	var email_str =frm.email.value;
	var filter=/^.+@.+\..{2,3}$/;
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if(trim(frm.category.value)=='') { 
		errorstr += "- Please Select Category.\n";
	}
	if(trim(frm.organizationType.value)=='') { 
		errorstr += "- Please Select Organization Type.\n";
	}
	if(trim(frm.organizationName.value)==''){ 
		errorstr += "- Please Enter Organization Name.\n";
	}
	if(trim(frm.firstName.value)==''){ 
		errorstr += "- Please Enter First Name.\n";
	}

	if(trim(frm.lastName.value)=='') { 
		errorstr += "- Please Enter Last Name.\n";
	}
	if(trim(frm.email.value)==''){ 
		errorstr += "- Please Enter Email Address.\n";
	}else if(!(filter.test(email_str))){
		errorstr +=  "- Please Enter a valid Email Address.\n";
	}
	if(trim(frm.secondaryEmail.value)== ''){
	}else if(!(filter.test(frm.secondaryEmail.value))){
		errorstr +=  "- Please Enter a valid Secondary Email Address.\n";
	}

	if (errorstr != ''){
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}else{
		return true;
	}	
}





///validate training program - admin

function validateProgram_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.title.value)=='') 

	{ 

		errorstr += "- Please Enter Title.\n";

	}

	if(trim(frm.obj1.value)=='') 

	{ 

		errorstr += "- Please Enter Objective.\n";

	}

	if(trim(frm.startDate.value)>trim(frm.endDate.value)) 

	{ 

		errorstr += "- Please Enter correct Date.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}





///validate training team - admin

function validateTeam_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.name.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.position.value)=='') 

	{ 

		errorstr += "- Please Enter Position.\n";

	}

	if(trim(frm.details.value)=='') 

	{ 

		errorstr += "- Please Enter Detail.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training project - admin

function validateProject_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.title.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.details.value)=='') 

	{ 

		errorstr += "- Please Enter Detail.\n";

	}

	if(trim(frm.type.value)=='') 

	{ 

		errorstr += "- Please Select Type.\n";

	}

	

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate Client - admin

function validateClient_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.name.value)=='') 

	{ 

		errorstr += "- Please Enter Name.\n";

	}

	if(trim(frm.industry.value)=='') 

	{ 

		errorstr += "- Please Select Inductry.\n";

	}

	if(trim(frm.country.value)=='') 

	{ 

		errorstr += "- Please Select Country.\n";

	}

	

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate training program - admin

function validateEvent_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.title.value)=='') 

	{ 

		errorstr += "- Please Enter Title.\n";

	}

	if(trim(frm.obj1.value)=='') 

	{ 

		errorstr += "- Please Enter Objective.\n";

	}

	

	if(trim(frm.startDate.value)>trim(frm.endDate.value)) 

	{ 

		errorstr += "- Please Enter correct Date.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate community - admin

function validateCommunity_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.heading.value)=='') 

	{ 

		errorstr += "- Please Enter Heading.\n";

	}

	if(trim(frm.description.value)=='') 

	{ 

		errorstr += "- Please Enter Description.\n";

	}

	if(trim(frm.category.value)=='') 

	{ 

		errorstr += "- Please Select Category.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



///validate community - admin

function validateComment_admin(frm)

{

	var filter=/^.+@.+\..{2,3}$/;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

				

	if(trim(frm.userId.value)=='') 

	{ 

		errorstr += "- Please Select User.\n";

	}

	if(trim(frm.comment.value)=='') 

	{ 

		errorstr += "- Please Enter Comment.\n";

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////































//validae faq manager

function faq(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.question.value) == "")

	{

	  errorstr +=  "- Please Enter Question.\n"; 

	}

   if(trim(frm.faqAns.value) == "")

	{

	  errorstr +=  "- Please Enter Answer.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

function userFaq(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.faqQues.value) == "")

	{

	  errorstr +=  "- Please Enter Question.\n"; 

	}

   if(trim(frm.faqAns.value) == "")

	{

	  errorstr +=  "- Please Enter Answer.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



//validate user testimonil

function validate_testimonial(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.testimonial.value) == "")

	{

	  errorstr +=  "- Please Enter Testimonial.\n"; 

	}   

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate ftp details

function validateFtp(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	var strDomain=document.getElementById('domainName').value;

	var isDot=strDomain.indexOf('.');

	

	/*var splitResult=strDomain.split(".");

	alert(splitResult.length);*/

	if(trim(frm.domainName.value) == "")

	{

	  errorstr +=  "- Please Enter Domain.\n"; 

	}

	/*else

	{

		if(isDot==-1)

		{

			errorstr +=  "- Domain Name should have dot(.).\n"; 

		}

	}*/

   if(trim(frm.ftp_username.value) == "")

	{

	  errorstr +=  "- Please Enter FTP Username.\n"; 

	}

	if(trim(frm.ftp_password.value) == "")

	{

	  errorstr +=  "- Please Enter FTP Password.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate admin page



function validate_admin_page(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.pageHeading.value) == "")

	{

	  errorstr +=  "- Please Enter Page Heading.\n"; 

	}

   if(trim(frm.pageName.value) == "")

	{

	  errorstr +=  "- Please Enter Page Name.\n"; 

	}

	 if(trim(frm.pageContent.value) == "")

	{

	  errorstr +=  "- Please Enter Page Content.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate link manager

function validateLink(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.linkHeading.value) == "")

	{

	  errorstr +=  "- Please Enter Link Heading.\n"; 

	}

   if(trim(frm.linkName.value) == "")

	{

	  errorstr +=  "- Please Enter Link Name.\n"; 

	}

	 if(trim(frm.linkContent.value) == "")

	{

	  errorstr +=  "- Please Enter Link Content.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//

//validate contact form

function validateContact(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;	

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.name.value) == "")

	{

	  errorstr +=  "- Please Enter Name.\n"; 

	}

   if(trim(frm.email.value) == "")

	{

	  errorstr +=  "- Please Enter Email.\n"; 

	}

	else if(!filter.test(email_str))

	{

		errorstr +=  "- Please Enter a  valid Email.\n"; 

	}

	 if(trim(frm.phone.value) == "")

	{

	  errorstr +=  "- Please Enter Phone Number.\n"; 

	}

	 if(trim(frm.sendSubject.value) == "")

	{

	  errorstr +=  "- Please Enter Subject.\n"; 

	}

	 if(trim(frm.message.value) == "")

	{

	  errorstr +=  "- Please Enter Message.\n"; 

	}

	 if(trim(frm.securityCode.value) == "")

	{

	  errorstr +=  "- Please Enter Security Code Displayed.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate Custom Quote

function validateQuote(frm)

{

	var email_str =frm.email.value;

	var filter=/^.+@.+\..{2,3}$/;	

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.name.value) == "")

	{

	  errorstr +=  "- Please Enter First Name.\n"; 

	}

	

   if(trim(frm.email.value) == "")

	{

	  errorstr +=  "- Please Enter Email.\n"; 

	}

	else if(!filter.test(email_str))

	{

		errorstr +=  "- Please Enter a  valid Email.\n"; 

	}

	 if(trim(frm.phone.value) == "")

	{

	  errorstr +=  "- Please Enter Phone Number.\n"; 

	}

	 if(trim(frm.requirements.value) == "")

	{

	  errorstr +=  "- Please Enter Your Requirements.\n"; 

	}

	 if(trim(frm.securityCode.value) == "")

	{

	  errorstr +=  "- Please Enter Security Code.\n"; 

	}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



//end

// validate payment page



function validatePayment(frm)

{

	//alert();

	//return false;

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if(trim(frm.fName.value) == "")

	{

	  errorstr +=  "- Please Enter First Name.\n"; 

	}

   if(trim(frm.lName.value) == "")

	{

	  errorstr +=  "- Please Enter Last Name.\n"; 

	}

	 if(trim(frm.phone.value) == "")

	{

	  errorstr +=  "- Please Enter Phone Number.\n"; 

	}

	if(trim(frm.firstName.value) == "")

	{

	  errorstr +=  "- Please Enter First Name on Card.\n"; 

	}

   if(trim(frm.lastName.value) == "")

	{

	  errorstr +=  "- Please Enter Last Name on Card.\n"; 

	}

	if(trim(frm.creditCardNumber.value) == "")

	{

	  errorstr +=  "- Please Enter Credit Card Number.\n"; 

	}

	if(trim(frm.cvv2Number.value) == "")

	{

	  errorstr +=  "- Please Enter CVC Number.\n"; 

	}

	if(trim(frm.address1.value) == "")

	{

	  errorstr +=  "- Please Enter Billing Address.\n"; 

	}

	if(trim(frm.city.value) == "")

	{

	  errorstr +=  "- Please Enter City.\n"; 

	}

	if(trim(frm.state.value) == "")

	{

	  errorstr +=  "- Please Select  State.\n"; 

	}

	if(trim(frm.zip.value) == "")

	{

	  errorstr +=  "- Please Enter Zip.\n"; 

	}

	if(frm.agree.checked==false)

	{

	  errorstr +=  "- Please click on the Chekbox to agree to the terms and service.\n"; 

	}

	if(frm.termService.checked==false)

	{

	  errorstr +=  "- Please click on the Chekbox that you fully understand the terms and service.\n"; 

	}

	

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//



//validate template

function validateTemplate(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	if (frm.templateName.value=='') { errorstr += "- Please Enter Template Title.\n";}

	if (frm.layoutName.value=='') { errorstr += "- Please Enter layout Name.\n";}

	if (frm.theme.value=='') { errorstr += "- Please Enter theme.\n";}

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//validate Testimonial



function validateTestimonial(frm)

{

	

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	

	if(trim(frm.testimonial.value) == "")

	{

	  errorstr +=  "- Please Enter Testimonial.\n"; 

	}

   if(trim(frm.writtenBy.value) == "")

	{

	  errorstr +=  "- Please Enter the name Who wrote this Testimoanil.\n"; 

	}



	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}



//validate newsletter template

function validateNewsletterTemplate(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	



		if (frm.templateName.value=='') { errorstr += "- Please Enter Template Name.\n";}

		if (frm.subject.value=='') { errorstr += "- Please Enter Subject.\n";}

		if (frm.adminEmail.value=='') { errorstr += "- Please Enter Admin Email.\n";}

		if (frm.message.value=='') { errorstr += "- Please Enter Message.\n";}

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//

	function goto(obj)

 {

 	window.location.href=obj;

 }

//

function validEmailAddress(email)

{

		invalidChars = " /:,;~"

		if (email == "") 

		{

			return (false);

		}

		for (i=0; i<invalidChars.length; i++) 

		{

			badChar = invalidChars.charAt(i)

			if (email.indexOf(badChar,0) != -1) 

			{

				return (false);

			}

		}

		atPos = email.indexOf("@",1)

		if (atPos == -1) 

		{

			return (false);

		}

		if (email.indexOf("@",atPos+1) != -1) 

		{

			return (false);

		}

		periodPos = email.indexOf(".",atPos)

		if (periodPos == -1) 

		{

			return (false);

		}

		if (periodPos+3 > email.length)	

		{

			return (false);

		}

			

		return (true);

}





function validateSubscriber(frm)

{

	var errorstr = '';

	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";

	



		if (frm.subscriberName.value=='') { errorstr += "- Please Enter Subscriber Name.\n";}

		if(frm.subscriberEmail.value=="")

		{

		  errorstr +=  "- Please Enter Subscriber Email Address.\n"; 

		}

		else

		{		 

			if(!validEmailAddress(frm.subscriberEmail.value))

			{

				errorstr +=  "- Email Address must be Valid.\n";

			}

		}

		

	if (errorstr != '')

	{

		msgstr = msgstr + errorstr;

		alert(msgstr);

		return false;

	}

	else

	{

		return true;

	}	

}

//previous code from user manager

function check_checkbox(objForm)

{

	len = objForm.elements.length;



	var g=0;

	for( i=0 ; i<len ; i++) 

	{

		if (objForm.elements[i].type=='checkbox' && objForm.elements[i].name!="check_all" )

		{

		  if(objForm.elements[i].checked==true)

		  {	

			  	g=g+1;

		  }		

		} 

	}



	if(g<1)

	{

		alert("Please select atleast one checkbox.");

		return(false);

	}

	else

	{

		return(true);

	}



}



function checkall(objForm)

{

	len = objForm.elements.length;

	var i=0;

	for( i=0 ; i<len ; i++) 

	{

		if (objForm.elements[i].type=='checkbox') objForm.elements[i].checked=objForm.check_all.checked;

	}

}



function del_prompt(frmobj,comb)

{

	if(check_checkbox(frmobj))

	{

		if(comb=='Delete')

		{

			if(confirm ("Are you sure you want to delete the selected record(s)?"))

			{

				frmobj.submit();

			}

			

			else

			{ 

				return false;

			}

		}

	}

	else

	{

		return(false);

	}

}

 function checkDomainB(nname)

{

var arr = new Array(

'.com','.net','.org','.biz','.coop','.info','.museum','.name',

'.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',

'.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',

'.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',

'.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',

'.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',

'.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',

'.ec','.ee','.eg','.eh','.er','.es','.et','.fi','.fj','.fk','.fm',

'.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',

'.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',

'.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',

'.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',

'.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',

'.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',

'.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',

'.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',

'.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',

'.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',

'.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',

'.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',

'.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',

'.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',

'.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',

'.wf','.ye','.yt','.yu','.za','.zm','.zw');



var mai = nname;

var val = true;

//alert(mai.indexOf('.'));

var oc = mai.indexOf(".");

var arrD = new Array();

arrD=mai.split('.');

//alert(arrD.length);

var arrL=arrD.length;

if(arrL>2)

{

return false;

}

var dot = mai.lastIndexOf(".");

var dname = mai.substring(0,dot);

var ext = mai.substring(dot,mai.length);

//alert(ext);



if(dot>2 && dot<57)

{

for(var i=0; i<arr.length; i++)

{

if(ext == arr[i])

{

val = true;

break;

}

else

{

val = false;

}

}

if(val == false)

{

// alert("Your domain extension "+ext+" is not correct");

return false;

}

else

{

for(var j=0; j<dname.length; j++)

{

var dh = dname.charAt(j);

var hh = dh.charCodeAt(0);

if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)

{

if((j==0 || j==dname.length-1) && hh == 45)

{

//alert("Domain name should not begin are end with '-'");

return false;

}

}

else {

// alert("Your domain name should not have special characters");

return false;

}

}

}

}

else

{

// alert("Your Domain name is too short/long");

return false;

}

}



function getElements(obj){
	
	var x=document.getElementsByName("industry[]");
	if(obj.checked){
		for (var i = 0; i < x.length; i++){
			x[i].checked = true;
		} 
	}else{
		for (var i = 0; i < x.length; i++){
			x[i].checked = false;
		} 
	}
}

function getElements1(obj){
	var x=document.getElementsByName("functionalArea[]");
	if(obj.checked){
		for (var i = 0; i < x.length; i++){
			x[i].checked = true;
		} 
	}else{
		for (var i = 0; i < x.length; i++){
			x[i].checked = false;
		} 
	}
}

//end